package parttern.delegate;

// 静态代理类
public class ProfessionalAgent implements IShoes, IApple {

    /**
     * 代购nike
     */
    private IShoes mShoes;    // 持有真实主题类1的引用

    public ProfessionalAgent(IShoes shoes) {
        this.mShoes = shoes;
    }

    @Override
    public void tryOn() {
        mShoes.tryOn();
        System.out.println("试完挑好，代购我来帮你砍价!");
    }

    @Override
    public void buyShoes() {
        mShoes.buyShoes();
        System.out.println("买完nike，后期有问题找代购我!");
    }

    /**
     * 代购iPhone
     */
    private IApple mApple;    // 持有真实主题类2的引用

    public ProfessionalAgent(IApple apple) {
        this.mApple = apple;
    }

    @Override
    public void chose() {
        System.out.println("代购我来给你推荐性价比高的型号!");
        mApple.chose();
    }

    @Override
    public void buyIPhone() {
        mApple.buyIPhone();
        System.out.println("买完iPhone，后期有问题找代购我!");
    }
}